﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/Main.master" AutoEventWireup="true" CodeFile="RSSManager.aspx.cs" MaintainScrollPositionOnPostback="true" Inherits="Sermons_RSSManager" Title="RSS Manager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <script type="text/javascript">

        function ConfirmDelete() {
            return confirm("Really delete this file?");
        }
    
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" Runat="Server">


    <h2 class="mainTitle sermDl"><span>Sermon For Download</span></h2>
    
    <asp:MultiView ID="mvMain" ActiveViewIndex="0" runat="server">
    <asp:View ID="viewForm" runat="server">

        <h3>Add New Sermon</h3>
        <div class="form">
            <div class="fItem">
                <span class="fiName">Title</span>
                <span class="fiElem">
                    <asp:TextBox ID="txtTitle" CssClass="txtBox" ValidationGroup="add" runat="server" />
                    <asp:RequiredFieldValidator ControlToValidate="txtTitle" Display="Dynamic" ValidationGroup="add" ErrorMessage="Please enter a title" runat="server">*</asp:RequiredFieldValidator>
                </span>
            </div>            
            <div class="fItem">
                <span class="fiName">Date of Talk</span>
                <span class="fiElem">
                    <asp:DropDownList ID="ddlDay" runat="server"></asp:DropDownList> / 
                    <asp:DropDownList ID="ddlMonth" runat="server"></asp:DropDownList> /
                    <asp:DropDownList ID="ddlYear" runat="server"></asp:DropDownList>
                    <asp:CustomValidator ID="valDateOfTalk" ErrorMessage="Please enter a valid date" ValidationGroup="add" runat="server">*</asp:CustomValidator>
                </span>
            </div> 
            <div class="fItem">
                <span class="fiName">Speaker</span>
                <span class="fiElem">
                    <asp:TextBox ID="txtSpeaker" CssClass="txtBox" ValidationGroup="add" runat="server" />
                    <asp:RequiredFieldValidator ControlToValidate="txtSpeaker" Display="Dynamic" ValidationGroup="add" ErrorMessage="Please enter the speaker name" runat="server">*</asp:RequiredFieldValidator>
                </span>
            </div>
            <div class="fItem">
                <span class="fiName">Passage</span>
                <span class="fiElem"><asp:TextBox ID="txtPassage" CssClass="txtBox" runat="server" /></span>
            </div>
            <div class="fItem">
                <span class="fiName">URL</span>
                <span class="fiElem">
                    <asp:TextBox ID="txtLink" CssClass="txtBox" ValidationGroup="add" runat="server" />
                    <asp:RequiredFieldValidator ControlToValidate="txtLink" Display="Dynamic" ValidationGroup="add" ErrorMessage="Please enter the URL of the recorded sermon" runat="server">*</asp:RequiredFieldValidator>
                </span>
            </div>
            <div class="fItem">
                <span class="fiName">File size</span>
                <span class="fiElem">
                    <asp:DropDownList ID="ddlMB" runat="server" /> . <asp:DropDownList ID="ddlMBtenths" runat="server" /> MB
                    <asp:CustomValidator ID="valFileSize" ValidationGroup="add" ErrorMessage="Please enter the file size of the recording" runat="server">*</asp:CustomValidator>
                </span>
            </div>
            <div class="fItem">
                <span class="fiName">Sermon Length</span>
                <span class="fiElem">
                    <asp:DropDownList ID="ddlHours" runat="server"></asp:DropDownList>                        
                    <asp:DropDownList ID="ddlMinutes" runat="server"></asp:DropDownList>                        
                    <asp:DropDownList ID="ddlSeconds" runat="server"></asp:DropDownList>
                    (HH:MM:SS)
                    <asp:CustomValidator ID="valSermonLength" ValidationGroup="add" ErrorMessage="Please enter the length of the sermon" runat="server">*</asp:CustomValidator>
                </span>
            </div>
            <div class="fItem">
                <div class="fiAction">
                    <asp:Button ID="btnCreate" Text="Add New" ValidationGroup="add" runat="server" />
                </div>
            </div>
        </div>

        <h3>Existing Sermons</h3>    
        <asp:Repeater ID="rptrItems" runat="server">
        <ItemTemplate>    
            <div class="form">
                <div class="fItem">
                    <span class="fiName">Title</span>
                    <span class="fiElem">
                        <asp:TextBox ID="txtTitle" CssClass="txtBox" runat="server" />
                        <asp:RequiredFieldValidator ValidationGroup="update" ControlToValidate="txtTitle" Display="Dynamic" ErrorMessage="Please enter a title" runat="server">*</asp:RequiredFieldValidator>
                    </span>
                </div>            
                <div class="fItem">
                    <span class="fiName">Date of Talk</span>
                    <span class="fiElem">
                        <asp:DropDownList ID="ddlDay" runat="server"></asp:DropDownList> /
                        <asp:DropDownList ID="ddlMonth" runat="server"></asp:DropDownList> /
                        <asp:DropDownList ID="ddlYear" runat="server"></asp:DropDownList>
                        <asp:CustomValidator ID="valDateOfTalk" ValidationGroup="update" ErrorMessage="Please enter a valid date" OnServerValidate="valDateOfTalk_ServerValidate" runat="server">*</asp:CustomValidator>
                    </span>
                </div>     
                <div class="fItem">
                    <span class="fiName">Speaker</span>
                    <span class="fiElem">
                        <asp:TextBox ID="txtSpeaker" CssClass="txtBox" runat="server" />
                        <asp:RequiredFieldValidator ValidationGroup="update" ControlToValidate="txtSpeaker" Display="Dynamic" ErrorMessage="Please enter the speaker name" runat="server">*</asp:RequiredFieldValidator>
                    </span>
                </div>
                <div class="fItem">
                    <span class="fiName">Passage</span>
                    <span class="fiElem"><asp:TextBox ID="txtPassage" CssClass="txtBox" runat="server" /></span>
                </div>
                <div class="fItem">
                    <span class="fiName">URL</span>
                    <span class="fiElem">
                        <asp:TextBox ID="txtLink" CssClass="txtBox" runat="server" />
                        <asp:RequiredFieldValidator ValidationGroup="update" ControlToValidate="txtLink" Display="Dynamic" ErrorMessage="Please enter the URL of the recorded sermon" runat="server">*</asp:RequiredFieldValidator>
                    </span>
                </div>
                <div class="fItem">
                <span class="fiName">File size</span>
                <span class="fiElem">
                    <asp:DropDownList ID="ddlMB" runat="server" /> . 
                    <asp:DropDownList ID="ddlMBtenths" runat="server" /> MB
                    <asp:CustomValidator ID="valFileSize" ValidationGroup="update" ErrorMessage="Please enter the file size of the recording" runat="server">*</asp:CustomValidator>
                </span>
            </div>
                <div class="fItem">
                    <span class="fiName">Sermon Length</span>
                    <span class="fiElem">
                        <asp:DropDownList ID="ddlHours" runat="server"></asp:DropDownList>                        
                        <asp:DropDownList ID="ddlMinutes" runat="server"></asp:DropDownList>                        
                        <asp:DropDownList ID="ddlSeconds" runat="server"></asp:DropDownList>
                        (HH::MM::SS)
                        <asp:CustomValidator ID="valSermonLength" ValidationGroup="update" ErrorMessage="Please enter the length of the sermon" runat="server">*</asp:CustomValidator>
                    </span>
                </div>
                <div class="fItem">
                    <div class="fiAction">
                        <asp:Button ID="btnUpdate" Text="Update" CommandName="Update" runat="server" />
                        <asp:Button ID="btnDelete" Text="Delete" CommandName="Delete" OnClientClick="return ConfirmDelete();" runat="server" />
                        <br />
                        <asp:Label ID="lblUpdated" CssClass="updated" EnableViewState="false" runat="server"></asp:Label>
                    </div>
                </div>            
            </div>    
        </ItemTemplate>
        </asp:Repeater>
    
    </asp:View>
    <asp:View ID="viewAcknowledgement" runat="server">
    
        <h3>Confirmation - <asp:Literal ID="litConfirmMsg" EnableViewState="false" runat="server" /></h3>
        <p><a href="RSSManager.aspx">&lt;&lt; Go Back</a></p>
    
    </asp:View>
    </asp:MultiView>
    
    <asp:Literal ID="litTemp" runat="server" />

</asp:Content>

